﻿using System;

using System.Collections.Generic;
using System.Text;
using System.Collections.ObjectModel;

namespace Silvermoon.Controls.Navigation
{
    public class PickerCollection:Collection<Control>
    {
        private PickerBase picker;

        public PickerCollection(PickerBase picker)
            : base()
        {
            this.picker = picker;
        }

        protected override void InsertItem(int index, Control item)
        {
            base.InsertItem(index, item);
            OnCollectionChanged();
        }

        protected override void RemoveItem(int index)
        {
            base.RemoveItem(index);
            OnCollectionChanged();
        }

        protected override void ClearItems()
        {
            base.ClearItems();
            OnCollectionChanged();
        }

        protected virtual void OnCollectionChanged()
        {
            picker.OnCollectionChanged();
        }
    }
}
